package com.acme.task6;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;


public class JavaCommentClear {
	
	public static final String DEF_COMMENT_OPEN   = "/*";
	public static final String DEF_COMMENT_CLOSE  = "*/";
	public static final String DEF_COMMENT_SINGLE = "//";
	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new FileReader(args[0].toString()));
		
		try {
			String line = br.readLine();
			boolean check = false;
			while (line != null) {
				
				int checkindex = line.indexOf(!check?JavaCommentClear.DEF_COMMENT_OPEN:JavaCommentClear.DEF_COMMENT_CLOSE);
			    if(checkindex >= 0){
					check = !check;	
					line = br.readLine();
			    	continue;
				}
			    if(check){
			    	line = br.readLine();
			    	continue;
			    }
			 			
				String[] subline = line.split(JavaCommentClear.DEF_COMMENT_SINGLE);
				System.out.println(subline[0]);
				
				line = br.readLine();
			}
			
		} finally {
			br.close();
		}

	}

}